<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="serviceurl" value="${ctx}/stwy/report" />
<html>
<head>
<title>report</title>
<link href="${ctx}/assets/rap/css/rap-report.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="container-fluid rap-page-content">
		<div class="rap-page-area" id="rap-page-area-list">
			<div class="rap-searchbar">
				<form  id="rap-form-query" class="form-inline">
					
				</form>
			</div>
			<div class="" id="report">
			</div>
		</div>
		<!-- 非服务器分页脚本 -->
		<%@include file="/WEB-INF/views/common/table_script.jsp"%>
	</div>
		
	<script type="text/javascript">
	var _reportName = "${reportName}";
	var _url =  '${serviceurl}/loadReport?reportName='+_reportName;
	var _exportUrl = '${serviceurl}/exportReport?reportName='+_reportName;
	function appendQueryForm(reportName){
		 var queryHtml ='';
		 var queryBtnHtml ='';
		if("report1"==reportName){
			queryHtml='<div class="form-group">'
						+'<label for="search_GTE_beginDate">报表日期 </label> ' 
						+'<input type="text" class="rap-input-date" id="search_GTE_beginDate" name="reportDate" autocomplete="on">'
					+'</div>';
		}else if("report2"==reportName){
			queryHtml='<div class="form-group">'
				+'<label for="search_GTE_beginDate">报表日期 </label> ' 
				+'<input type="text" class="rap-input-date" id="search_GTE_beginDate" name="reportDate" autocomplete="on">'
			+'</div>';
		}else if("report3"==reportName){
			
		}else if("report4"==reportName){
			
		}else if("report5"==reportName){
			
		}else if("report6"==reportName){
			
		}else if("report7"==reportName){
			
		}else{
			
		}
		var btnName = "刷新";
		if(queryHtml!=''){
			btnName = "查询";
		}
		queryBtnHtml = '<div class="form-group rap-searchbar-btn">'
							+'<button type="button" id="rap-btn-quickquery" onclick="onQuery();" > '+btnName+'</button> '
							//+'<button type="button" > 清空</button>'
							+'<button type="button" id="rap-btn-export" onclick="onExportReport();"><i class="fa fa-file-excel-o"></i> 导出</button>'
						+'</div>';
		$("#rap-form-query").html(queryHtml+queryBtnHtml);
		_rapui.setUIStyle(); 
	}
	function onQuery(){
		var div = $("#report")[0];
		var queryData = $("#rap-form-query").serializeArray();
		loadTable(div,_url,queryData);
	}
	function onExportReport(){
		onExport(_exportUrl);
	}
	$(document).ready(function() {
		appendQueryForm(_reportName);
		onQuery();
	});
	</script>
</body>
</html>